import { AboutComponent } from './../about/about.component';
import { ResetComponent } from './../reset/reset.component';
import { NavController } from 'ionic-angular';
import { Component } from '@angular/core';
import { NavigateService } from "../../service/index";

@Component({
    //moduleId: module.id,
    selector: 'div[setup]',
    templateUrl: './setup.component.html',
    styleUrls: ['./setup.component.scss']
})
export class SetupComponent {
    constructor(
        private router: NavigateService,
        public navCtrl: NavController
    ) { }

    ionViewWillEnter() {
        this.router.registGoBack(() => {
            let backBtn = document.getElementById("setup-back-btn");
            if (backBtn) {
                backBtn.click();
            }
        });
    }
    goReset() {
        // this.router.navigate(['reset']);
        this.navCtrl.push(ResetComponent, {},{ animate: false });
    }
    goAbout() {
        // this.router.navigate(['about']);
        this.navCtrl.push(AboutComponent, {}, { animate: false });
    }
    goBack() {
        // return this.router.navigate(["home"]);
        this.navCtrl.pop({ animate: false });
    }
}